import java.util.*;

public class Main {
    public static void main(String[] args) {
        List<Student> studentList = new ArrayList<>();
        for (int i = 0; i <= 100; i++) {
            Student student = new Student();
            random(student);
            studentList.add(student);
        }
        Map<String,List<Student>> stringListMap = group(studentList);
        System.out.println(stringListMap);
    }

    public static void random(Object O) {
        Random random = new Random();
    }

    public static String key(Student student){
        if (student.age < 18) {
            return "未成年";
        } else if (student.age < 53) {
            return "永远18";
        } else if (student.age < 98) {
            return "有退休金了";
        }
        return "成仙";
    }

    public static Map<String,List<Student>> group(List<Student> studentList) {
        Map<String,List<Student>> stringListMap = new HashMap<>();
        for (Student student : studentList) {
            String key = key(student);
            if (!stringListMap.containsKey(key)) {
                stringListMap.put(key,new ArrayList<>());
            }
            stringListMap.get(key).add(student);
        }
        return stringListMap;
    }
}
